//
//  CrosswiseFrameModel.m
//  MyScrollView
//
//  Created by iOS on 2017/10/26.
//  Copyright © 2017年 iOS. All rights reserved.
//

#import "CrosswiseFrameModel.h"

//是否是4s
#define isIphone4sAndIphone5 (SCREEN_WIDTH == 320)
#define isIphone6 (SCREEN_HEIGHT == 667 && SCREEN_WIDTH == 375)
#define isIphone6p (SCREEN_HEIGHT == 736 && SCREEN_WIDTH == 414)
#define isIphoneX (SCREEN_HEIGHT == 812)

@implementation CrosswiseFrameModel
static CrosswiseFrameModel *G_CrosswiseFrameModel;
+ (instancetype) getCrosswiseFrameModel{
    @synchronized(self) {
        if (!G_CrosswiseFrameModel) {
            G_CrosswiseFrameModel = [[CrosswiseFrameModel alloc] init];
        }
    }
    return G_CrosswiseFrameModel;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        if (isIphone4sAndIphone5) {
            _cellWidth = SCREEN_WIDTH - 120;
        } else if (isIphone6) {
            _cellWidth = SCREEN_WIDTH - 150;
        } else if (isIphone6p) {
            _cellWidth = SCREEN_WIDTH - 180;
        }
        _collectionViewHigth = 250;
        if (isIphone4sAndIphone5) {
            _collectionViewHigth = 200;
        }
        _cellHeight = self.cellWidth * (9.0/16.0);
    }
    return self;
}

- (CGFloat) cellWidth {
    return _cellWidth;
}

- (CGFloat) cellHeight {
    return _cellHeight;
}

- (CGFloat) collectionViewHigth {
    return _collectionViewHigth;
}


@end
